package com.ruoyi.factory.qylock.controller.api;

import com.ruoyi.common.core.domain.AjaxResult;

import com.ruoyi.factory.common.utils.RequestUtil;
import com.ruoyi.factory.qylock.service.QysEreceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @ClassName QysEreceiptController
 * @Description: TODO 契约锁电子收据
 * @Author LiuJiaji
 * @Date 2024/5/16 09:55
 **/
@RestController
@RequestMapping("/api/qysereceipt")
public class QysEreceiptController {

    @Autowired
    private QysEreceiptService qysEreceiptService;
    /**
     * @author: Liujiaji
     * @date: 2024/5/16 09:57
     * @description: TODO 向契约锁发起电签
     * @param: [request]
     * @return: com.ruoyi.common.core.domain.AjaxResult
     **/
    @PostMapping("/pushtoqys")
    public AjaxResult pushtoqys(@RequestBody String request){

        return qysEreceiptService.pushtoqys(request);
    }

    @PostMapping("/upStatusNotify")
    public AjaxResult upStatus(HttpServletRequest request){
        Map<String, String> notifyResult = RequestUtil.getRequestParams(request);
        return qysEreceiptService.upStatus(notifyResult);
    }

}
